<?xml version="1.0" encoding="UTF-8"?>
<Module>
    <ModulePrefs
            title="__MSG_gadgetTitleDocsFolder__"
            title_url="http://gadglet.appspot.com/gadget.jsp?gname=DocsFolder"
            author="Gadglet Team"
            author_email="info@gadglet.com"
            description="This simple gadget shows a tree view of all your folders.  Click on a folder to see the documents within.  Click on a document to edit/view"
            screenshot="screenshot.png"
            thumbnail="thumbnail.png" author_affiliation="Gadglet Team." directory_title="Folder documents" height="350">
        <Require feature="dynamic-height" />
        <Require feature="settitle" />
        <Require feature="locked-domain" />
        <Require feature="setprefs" />
		    <OAuth>
      <Service>
        <Access method="GET" url="https://www.google.com/accounts/OAuthGetAccessToken"/> 
        <Request method="GET" url="https://www.google.com/accounts/OAuthGetRequestToken?scope=https://docs.google.com/feeds/"/> 
        <Authorization url="https://www.google.com/accounts/OAuthAuthorizeToken"/> 
      </Service>
    </OAuth>
        <Locale lang="ALL" messages="http://gadglet.appspot.com/static/gadgets/messages/ALL_ALL.xml" />
        <Locale lang="iw" messages="http://gadglet.appspot.com/static/gadgets/messages/iw_ALL.xml" />
        <Locale lang="en" messages="http://gadglet.appspot.com/static/gadgets/messages/en_ALL.xml" />
        <Locale lang="es" messages="http://gadglet.appspot.com/static/gadgets/messages/es_ALL.xml" />
        <Locale lang="de" messages="http://gadglet.appspot.com/static/gadgets/messages/de_ALL.xml" />
        <Locale lang="fr" messages="http://gadglet.appspot.com/static/gadgets/messages/fr_ALL.xml" />
        <Locale lang="ru" messages="http://gadglet.appspot.com/static/gadgets/messages/ru_ALL.xml" />
    </ModulePrefs>
    <UserPref name="selectedFolder" datatype="hidden" />
    <UserPref name="selectedFolderTitle" datatype="hidden" />
    <UserPref name="tCode" datatype="string" />
    <Content type="html"><![CDATA[<!DOCTYPE html><!-- ALm6fM1Y0spHlB/Ov4mdbkLz7PnHDJWgcCRCSP6aCLqTMmkPOzzGPddw+AtGmKmd+tQw6DE/8mvbVVdgXOdLQdvW7sCPEHUxPYLQefFMC9ReWtz7ity+XVCfpOK+zxF8dUCYu7gdlTnJrVILhv9Jd5iDuvC9La2O3X6NH6ttwQn3xkpUQe851VM= -->
<script src="http://gadglet.appspot.com/static/js/popup.js"></script>
<link rel="stylesheet" type="text/css" href="http://gadglet.appspot.com/static/gwt/standard/standard.css"/>
<div id="message" class="div-hidden"></div>
<div id="approval" class="div-hidden">
     <a href="#" id="personalize">__MSG_gadgetMsgPleaseApproveDocs__</a>
</div>

<div id="waiting" class="div-hidden">
   <a href="#" id="approvaldone"> __MSG_gadgetMsgApproveInProcess__</a>
</div>
<div id="ananGadgets" class="div-hidden"> <div id="ananGadgetsRoot" ></div></div>

 <script type="text/javascript">
    function showOneSection(toshow) {
      var sections = [ 'message', 'approval', 'waiting','ananGadgets' ];
      for (var i=0; i < sections.length; ++i) {
        var s = sections[i];
        var el = document.getElementById(s);
        if (s === toshow) {
          el.style.display = "block";
        } else {
          el.style.display = "none";
        }
      }
    }

    function testConn() {
        var params = {};
        url = "https://docs.google.com/feeds/documents/private/full?max-results=1";
        params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
        params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.OAUTH;
        params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
        params[gadgets.io.RequestParameters.HEADERS] = {"GData-Version":"2.0"}
        gadgets.io.makeRequest(url, function (response) { 
          if (response.oauthApprovalUrl) {
            var popup = shindig.oauth.popup({
              destination: response.oauthApprovalUrl,
              windowOptions: null,
              onOpen: function() { showOneSection('waiting'); },
              onClose: function() { testConn(); }
            });
        
            var personalize = document.getElementById('personalize');
            personalize.onclick = popup.createOpenerOnClick();
            var approvaldone = document.getElementById('approvaldone');
            approvaldone.onclick = popup.createApprovedOnClick();
            showOneSection('approval');
          } else if (response.data) {
            showOneSection('ananGadgets');
           
          } else {
            var message = document.getElementById('message');
            var prefs = new gadgets.Prefs();
            var err = document.createTextNode(prefs.getMsg("gadgetMsgApproveError"));
            message.appendChild(err);
            showOneSection('message');
          }
        }, params);
      }
     
      gadgets.util.registerOnLoadHandler(testConn);
 </script>    
<script>function DocsFolder(){var J='',R='" for "gwt:onLoadErrorFn"',T='" for "gwt:onPropertyErrorFn"',vb='"><\/script>',Z='&',tb='.cache.js',sb='.cache.js$',O='/',mb='08B97007492D269FAE986EDEBFD11276',lb='2.1',nb='23F89E94CF21AF05B9801DAB1787B4C6',rb=':',ub='<script src="',V='=',Q='Bad handler "',ob='C374A84692A283B06F4EE9B6830EEAA6',pb='DFB3AEECA8115949EA1C69BC1ADABDC9',L='DocsFolder',qb='EF812586C8DBDA330C7FA7861AE9E6EA',Y='_',X='country',M='external.gwtOnLoad failed: ',fb='gecko',gb='gecko1_8',K='gwt.hybrid',P='gwt:onLoadErrorFn',S='gwt:onPropertyErrorFn',U='gwt:property',eb='ie6',db='ie8',W='lang',jb='moduleStartup',cb='msie',kb='onModuleLoadStart',_='opera',bb='safari',ib='startup',hb='unknown',N='url',$='user.agent',ab='webkit';var h=window,i=document,j=h.external,k,l,m=J,n={},o=[],p=[],q=[],r=0,s,t,u=h.__gwtStatsEvent?function(a){return h.__gwtStatsEvent(a)}:null;if(!h.__gwt_stylesLoaded){h.__gwt_stylesLoaded={}}if(!h.__gwt_scriptsLoaded){h.__gwt_scriptsLoaded={}}function v(){try{return j&&(j.gwtOnLoad&&h.location.search.indexOf(K)==-1)}catch(a){return false}}
function w(){if(l){if(v()){try{j.gwtOnLoad(h,L,r)}catch(a){h.alert(M+a)}}else if(k){k(s,L,m,r)}}}
function x(){m=h.gadgets.util.getUrlParameters()[N];m=m.substring(0,m.lastIndexOf(O)+1)}
function y(){var b;var c=new h.gadgets.Prefs;if(b=c.getString(P)){try{s=eval(b)}catch(a){alert(Q+e+R)}}if(b=c.getString(S)){try{t=eval(b)}catch(a){alert(Q+e+T)}}if(b=c.getArray(U)){for(var d=0;d<b.length;d++){var e=b[d];if(e){var f,g=e.indexOf(V);if(g>=0){name=e.substring(0,g);f=e.substring(g+1)}else{name=e;f=J}n[name]=f}}}}
function z(){var a=h.location.search;var b=A(a,W);if(b!=null){country=A(a,X);if(country!=null){h.__gwt_Locale=b+Y+country}else{h.__gwt_Locale=b}}}
function A(a,b){var c=a.indexOf(b+V);if(c<0){return undefined}var d=a.substring(c);var e=d.indexOf(V)+1;var f=d.indexOf(Z);if(f==-1){f=d.length}return d.substring(e,f)}
function D(a,b){var c=q;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b}
function E(a){var b=p[a](),c=o[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(t){t(a,d,b)}throw null}
p[$]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(b.indexOf(_)!=-1){return _}else if(b.indexOf(ab)!=-1){return bb}else if(b.indexOf(cb)!=-1){if(document.documentMode>=8){return db}else{var d=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){var e=c(d);if(e>=6000){return eb}}}}else if(b.indexOf(fb)!=-1){return gb}return hb};o[$]={gecko1_8:0,ie6:1,ie8:2,opera:3,safari:4};DocsFolder.onScriptLoad=function(a){DocsFolder=null;k=a;w()};x();y();z();h.gadgets.util.registerOnLoadHandler(function(){if(!l){l=true;w()}});if(v()){h.$wnd=h;h.$doc=i;h.$moduleName=L;h.$moduleBase=m;h.__gwt_getProperty=E;h.__gwt_initHandlers=DocsFolder.__gwt_initHandlers;h.__gwt_module_id=0;h.fireOnModuleLoadStart=function(a){u&&u({moduleName:$moduleName,subSystem:ib,evtGroup:jb,millis:(new Date).getTime(),type:kb,className:a})};h.onunload=function(){j.gwtOnLoad(h,null,lb)}}else{var F;try{D([bb],mb);D([db],nb);D([_],ob);D([gb],pb);D([eb],qb);F=q[E($)];var G=F.indexOf(rb);if(G!=-1){r=Number(F.substring(G+1));F=F.substring(0,G)}}catch(a){return}var H=m+F;if(H.search(sb)<0){H=H.concat(tb)}var I=h.gadgets.io.getProxyUrl(H,{refreshInterval:31536000});i.write(ub+I+vb)}}
DocsFolder.__gwt_initHandlers=function(d,e,f){var g=window,h=g.onresize,i=g.onbeforeunload,j=g.onunload;g.onresize=function(a){try{d()}finally{h&&h(a)}};g.onbeforeunload=function(a){var b,c;try{b=e()}finally{c=i&&i(a)}if(b!=null){return b}if(c!=null){return c}};g.onunload=function(a){try{f()}finally{j&&j(a)}}};DocsFolder();</script>
<div id="__gwt_gadget_content_div"></div>]]></Content>
</Module>